package com.ram.controller;

import com.ram.pojo.RepairAttachment;
import com.ram.pojo.Result;
import com.ram.service.RepairAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/repair/attachment")
public class RepairAttachmentController {
    @Autowired
    private RepairAttachmentService service;
    @GetMapping("/list")
    public Result list(@RequestParam Integer requestId) { return Result.success(service.listByRequestId(requestId)); }
    @PostMapping
    public Result add(@RequestBody RepairAttachment attachment) { service.add(attachment); return Result.success(); }
    @DeleteMapping("/{id}")
    public Result delete(@PathVariable Integer id) { service.deleteById(id); return Result.success(); }
} 